1. Field of the Invention
The present invention relates to a filter coefficient setting apparatus, a filter coefficient setting method, and a recording medium recorded with a program.
2. Description of the Related Art
Recently, for example, each of some communicating apparatuses such as a mobile phone and a hands-free phone that can each be connected to an earphone microphone, incorporates an echo preventing circuit to prevent echoes generated due to sound coupling that travels along from a speaker to a microphone, electric reflection in a circuit, etc. For example, Japanese Patent Application Laid-Open Publication No. 3293029 discloses a circuit that prevents echoes by canceling an input signal using a signal having a phase that is an inverse of that of and the amplitude level equal to that of the input signal. However, the configuration disclosed in the above '029 publication needs to set the circuit constants of the circuit elements with high precision to cancel echoes with high precision. However, such a configuration is not easy and this circuit can not cancel echoes with high precision.
Therefore, a method of canceling echoes with high precision using digital processing is considered. FIG. 8 depicts an example of an echo preventing circuit that uses a DSP 100. As depicted, an analog signal indicating sound transmitted from a counterpart using a mobile phone, etc., is inputted into an AD converter 101. The signal converted into a digital signal by the AD converter 101 is applied with a convoluting process by FIR filters 102 and 103 in the DSP 100 based on the filter coefficients thereof, and is outputted. A signal outputted from the FIR filter 102 is inputted into a DA converter 104. The signal converted into an analog signal by the DA converter 104 is outputted to an earphone microphone through an input/output terminal 105 and is inputted into one of two terminals of a differential amplifying circuit 106. The signal outputted from the FIR filter 103 is inputted into a DA converter 107. The signal outputted from the DA converter 107 is inputted into the other terminal of the differential amplifying circuit 106.
The signal outputted from the differential amplifying circuit 106 is converted into a digital signal by an AD converter 108 and is inputted into the DSP 100. After being outputted from the DSP 100, this digital signal is converted into an analog signal by a DA converter 109 and is outputted as an output signal of the echo preventing circuit.
The DSP 100 acquires an impulse response of a section from the DA converter 104 to the AD converter 108 based on the output of the AD converter 108 obtained when the DSP 100 outputs an impulse to the DA converter 104. The DSP 100 acquires an impulse response of a section from the DA converter 107 to the AD converter 108 based on the output of the AD converter 108 obtained when the DSP 100 outputs an impulse to the DA converter 107. By setting properly the filter coefficients of the FIR filters 102 and 103 based on these impulse responses, echoes can be canceled with high precision.
When the impulse responses are acquired, impulse responses with high precision can not be obtained unless the magnitude of the impulse is proper and, as a result, the echoes can not be canceled effectively. FIGS. 9A to 9C depict examples of impulse responses corresponding to the magnitude of an impulse. As depicted in FIG. 9A, when the magnitude of the impulse is proper, an impulse response having the proper magnitude can be obtained. In contrast, as depicted in FIG. 9B, when the magnitude of the impulse is too small, the signal level of the impulse response is small and the precision of the impulse response is degraded due to background noises, circuit noises, etc. As depicted in FIG. 9C, when the magnitude of the impulse is too large, the impulse response overflows in the AD converter 108 and no accurate impulse response can be obtained.
Therefore, it is necessary to obtain an impulse having the proper magnitude as depicted in FIG. 9A by generating an impulse having a proper magnitude. However, the magnitude of the impulse varies depending on the internal impedance of an earphone microphone used, the sensitivity of a speaker, the sensitivity of a microphone, or dispersion of the resistors used in the differential amplifying circuit 106, etc. caused through manufacture thereof, etc. Therefore, it is difficult to determine in advance the proper magnitude of the impulse. Therefore, when the filter coefficients of the FIR filters 102 and 103 are set based on an impulse response obtained by generating a impulse having a predetermined magnitude, the echoes can not always be canceled effectively.